
#import "Person.h"

@implementation Person
+(NSString *)getCurrentLanguage{
    NSArray *languages = [NSLocale preferredLanguages];
    if(languages == nil){
        return nil;
    }else{
        if([languages count] == 0){
            return nil;
        }else{
            NSString *currentLanguage = [languages objectAtIndex:0];//
            NSLog(@"%@",currentLanguage);
            return currentLanguage;
            
        }
    }
}
//判断当前是否为中文
+(BOOL)isCurrentLanguageChinese{/*zh-Hans-CN,zh-Hant-CN,en-CN,ko-CN*/
    NSString *currentLanguage = [Person getCurrentLanguage];
    if(currentLanguage == nil){
        return NO;
    }else if([currentLanguage isEqualToString:@""]){
        return NO;
    }//
    NSRange subStrRange = [currentLanguage rangeOfString:@"zh-Hans"];
    if(subStrRange.length >0){
        //简体中文
        return YES;
    }//
    subStrRange = [currentLanguage rangeOfString:@"zh-Hant"];
    if(subStrRange.length >0){//繁体中文
        return YES;
    }//其他语言
    return NO;
}

@end
